package com.jt.testdemo;

import com.jt.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestSpringDemo1 {
    @Test
    public void testService(){
        //1.加载配置文件
        ApplicationContext context =
                new ClassPathXmlApplicationContext("bean1.xml");
        //2.对象创建并调用
        UserService userService = context.getBean("userService", UserService.class);
        userService.add();
    }
}
